<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Login</title>
    </h:head>
    <h:body>
        <h:form id="loginForm">
            <p:panel header="Login">
                <h:panelGrid columns="2" columnClasses="rightAlign, leftAlign">
                    <p:outputLabel for="username" value="Username:"></p:outputLabel>
                    <p:inputText id="username"
                                 label="Username"
                                 required="true"
                                 value="#{loginBean.username}">
                        <f:validateLength minimum="2" maximum="20"></f:validateLength>
                    </p:inputText>
                    <p:outputLabel for="password" value="Password:"></p:outputLabel>
                    <p:password id="password"
                                   label="Password"
                                   required="true"
                                   value="#{loginBean.password}">
                        <f:validateLength minimum="8"></f:validateLength>
                    </p:password>
                    <h:panelGroup></h:panelGroup>
                    <p:commandButton id="submit"
                                     action="#{loginBean.login()}"
                                     value="Login" update="@all">
                    </p:commandButton>
                </h:panelGrid>
            </p:panel>
            <p:link outcome="/accessPages/signup" value="Sign up here"/>
            <h:messages style="color: red"></h:messages>
        </h:form>
    </h:body>
</html>

